package com.xmz.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("book")
public class Book {

    @TableId(type = IdType.AUTO)
    private Integer bookId; // 图书ID
    private String title; // 图书名称
    private Integer authorId; // 作者ID
    private Integer publicationYear; // 出版年份
    @TableField(exist = false)
    private String authorName;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime; // 创建时间

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime; // 更新时
    @TableLogic
    private Integer deleted; // 删除标志
}
